import React, {useState} from 'react';
import {ConfigProvider, ThemeConfig} from "antd";
import {MyMessage} from "./common/components/Message";
import {MyNavigation} from "./common/components/Navigation";
import MyRouter from "@/router";

let changeThemeConfig:any
function App() {
    const [themeConfig,setThemeConfig] = useState<ThemeConfig>({
        token: {
            colorPrimary: '#05afd2',
        }
    })
    changeThemeConfig = setThemeConfig
    return (
        <>
            <ConfigProvider
                theme={themeConfig}
            >
                {/*全局消息提示组件*/}
                <MyMessage/>
                {/*全局跳转组件*/}
                <MyNavigation/>
                <MyRouter/>
            </ConfigProvider>
        </>
    );
}

export default App;
/* 向外抛出一个修改主题的方法 */
export const setThemeConfig = (config:ThemeConfig) => {
    changeThemeConfig(config)
}
